enum Authority {
    write = 1,
    read = 2,
    create = 4,
    delete = 8,
}

const newAuthority = Authority.write | Authority.create;

/**
 *
 * @param target
 * @param permission
 * @returns
 */
function isIncludesTargetAuthority(target: Authority, permission: Authority) {
    return (target & permission) === permission;
}
/**
 *
 * @param target
 * @param permission
 * @returns
 */
function deleteAuthority(target: Authority, permission: Authority) {
    return target ^ permission;
}
console.log(isIncludesTargetAuthority(newAuthority, Authority.read));

